#include <iostream>
using namespace std;
class Complex {
private:
    double imaginary;
    double realPart;
public:
    Complex(double r = 0.0, double i = 0.0) : realPart(r), imaginary(i) {}
    Complex operator+(int n) const {
        return Complex(realPart + n, imaginary);
    }
    friend Complex operator+(int r, const Complex& other) {
        return Complex(other.realPart + r, other.imaginary);
    }
    void print() const {
        cout << "Complex Number: " << realPart << " + " << imaginary << "i" << endl;
    }
    double getReal() const {
        return realPart;
    }
    double getImaginary() const {
        return imaginary;
    }
};
int main() {
    Complex a;
    Complex result;
    result = a + 5;  
    result.print();
    result = 5 + a;  
    result.print();
    double r, i;
    cout << "Enter the real and imaginary parts of a complex number: ";
    cin >> r >> i;
    Complex userComplex(r, i);
    userComplex.print();
    result = userComplex + 3;
    cout << "After adding 3: ";
    result.print();
    return 0;
}

